package com.itheima03;

import org.w3c.dom.ls.LSOutput;

import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

public class SetTest {
    public static void main(String[] args) {
        Set<String> s1=new TreeSet<>();
        s1.add("11");
        s1.add("22");
        s1.add("33");
        s1.add("00");
        Iterator<String> iter1 = s1.iterator();
        while (iter1.hasNext()) {
            String next = iter1.next();
            System.out.println(next);
        }
        for (String s : s1) {
            System.out.println(s);
        }
        s1.forEach(s-> System.out.println(s));

    }
}
